package com.avecsys.quotemanager.dao.user;

import java.util.List;

import com.avecsys.quotemanager.dao.common.BaseDAO;
import com.avecsys.quotemanager.exception.BusinessException;
import com.avecsys.quotemanager.exception.DAOException;
import com.avecsys.quotemanager.pojos.BuyerMasterPojo;
import com.avecsys.quotemanager.pojos.BuyerUsersPojo;
import com.avecsys.quotemanager.pojos.SupplierMasterPojo;
import com.avecsys.quotemanager.pojos.SupplierUsersPojo;
import com.avecsys.quotemanager.pojos.SystemUsersPojo;
import com.avecsys.quotemanager.pojos.UserMasterPojo;
import com.avecsys.quotemanager.utils.TransactionStatus;

public interface UserMasterDAO extends BaseDAO
{

	/**
	 * Method to mark the system user information as deleted
	 * 
	 * @param systemUsersPojo
	 * @return TransactionStatus
	 */
	public abstract TransactionStatus deleteSystemUser(SystemUsersPojo systemUsersPojo)
			throws DAOException;
	
	/**
	 * Method to mark the supplier user information as deleted
	 * 
	 * @param supplierUsersPojo
	 * @return TransactionStatus
	 */
	public abstract TransactionStatus deleteSupplierUser(SupplierUsersPojo supplierUsersPojo)
			throws DAOException;
	
	/**
	 * Method to mark the buyer user information as deleted
	 * 
	 * @param buyerUsersPojo
	 * @return TransactionStatus
	 */
	public abstract TransactionStatus deleteBuyerUser(BuyerUsersPojo buyerUsersPojo)
			throws DAOException;


	/**
	 * Method to return all userMasterPojo matching the email criteria with active status associated as
	 * Buyer
	 * 
	 * @param email
	 * @return List<UserMasterPojo>
	 * @throws DAOException
	 */
	public abstract List<UserMasterPojo> findAllActiveBuyerUsersByEmail(String email)
			throws DAOException;

	/**
	 * Method to return all userMasterPojo matching the email criteria with active status associated as
	 * Supplier
	 * 
	 * @param email
	 * @return List<UserMasterPojo>
	 * @throws DAOException
	 */
	public abstract List<UserMasterPojo> findAllActiveSupplierUsersByEmail(String email)
			throws DAOException;

	/**
	 * Method to return all the Administrator users for a supplier
	 * 
	 * @param supplierMasterPojo
	 * @return boolean
	 * @throws DAOException
	 */
	public abstract List<UserMasterPojo> findAllSupplierAdminUsers(SupplierMasterPojo supplierMasterPojo)
			throws DAOException;

	/**
	 * Method to find all the list of users for a supplier
	 * 
	 * @param supplierMasterPojo
	 * @return List<SupplierUsersPojo>
	 * @throws BusinessException
	 */
	public abstract List<SupplierUsersPojo> findAllUsersBySupplier(SupplierMasterPojo supplierMasterPojo)
			throws DAOException;
	
	
	/**
	 * Method to find all the list of users for the system
	 * 
	 * @return List<SystemUsersPojo>
	 * @throws BusinessException
	 */
	public abstract List<SystemUsersPojo> findAllUsersForSystem(Long companyId)
			throws DAOException;
	
	/**
	 * Method to find all the list of users for a buyer
	 * 
	 * @param supplierMasterPojo
	 * @return List<SupplierUsersPojo>
	 * @throws BusinessException
	 */
	public abstract List<BuyerUsersPojo> findAllUsersByBuyer(BuyerMasterPojo buyerMasterPojo)
			throws DAOException;

	/**
	 * Method to save Supplier User Information
	 * 
	 * @param supplierUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus saveSupplierUser(SupplierUsersPojo supplierUsersPojo)
			throws DAOException;

	/**
	 * Method to Update system User Information
	 * 
	 * @param systemUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus updateSystemUser(SystemUsersPojo systemUsersPojo)
			throws DAOException;
	
	/**
	 * Method to Update Supplier User Information
	 * 
	 * @param supplierUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus updateSupplierUser(SupplierUsersPojo supplierUsersPojo)
			throws DAOException;
	
	/**
	 * Method to Update Buyer User Information
	 * 
	 * @param buyerUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus updateBuyerUser(BuyerUsersPojo buyerUsersPojo)
			throws DAOException;
	
	/**
	 * Method to save Buyer User Information
	 * 
	 * @param buyerUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus saveBuyerUser(BuyerUsersPojo buyerUsersPojo)
			throws DAOException;
	
	/**
	 * Method to save system User Information
	 * 
	 * @param systemUsersPojo
	 * @return TransactionStatus
	 * @throws DAOException
	 */
	public abstract TransactionStatus saveSystemUser(SystemUsersPojo systemUsersPojo)
			throws DAOException;

}
